/*
 * list.h
 *
 *  Created on: 25 Nov 2010
 *      Author: samuel
 */

#ifndef LIST_H_
#define LIST_H_

typedef int ElementType;

struct Node;
typedef struct Node *PtrToNode;
typedef PtrToNode List;
typedef PtrToNode Position;

#define MAX_EXPONENT 100
struct ArrayNode;
typedef struct ArrayNode *ArrayPoly;

struct ListNode;
typedef struct ListNode *ListPoly;


#ifdef __cplusplus
extern "C"
{
#endif


List MakeList(const ElementType data[], int size);
List SortList(List l);
int IsEmpty(const List l);
Position Find(const List l, ElementType x);
void Delete(List l, ElementType x);
void Insert(ElementType data, List l, Position p);
void PrintList(const List l);

ArrayPoly MakeArrayPoly(int max_exponent);
void DestoryArrayPoly(ArrayPoly p);
void PrintArrayPoly(const ArrayPoly p);
ArrayPoly AddArrayPoly(const ArrayPoly p1, const ArrayPoly p2);
ArrayPoly MultiArrayPoly(const ArrayPoly p1, const ArrayPoly p2);

ListPoly MakeListPolyFromArrayPoly(const ArrayPoly p);
void DestoryListPoly(ListPoly p);
void PrintListPoly(const ListPoly p);
ListPoly AddListPoly(const ListPoly p1, const ListPoly p2);
ListPoly MultiListPoly(const ListPoly p1, const ListPoly p2);

#ifdef __cplusplus
}
#endif


#endif /* LIST_H_ */
